package org.come.init;

import java.awt.Image;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.WindowConstants;

import org.come.socket.GameClient;



public class CheckUpdateFrame extends JFrame implements Runnable {
    CheckUpdateJPanel checkUpdateJpanel;

    public CheckUpdateFrame() {
        this.setTitle(GameClient.BT);
        this.setResizable(false);
        this.setUndecorated(false);
        checkUpdateJpanel = new CheckUpdateJPanel();
        this.setContentPane(checkUpdateJpanel);
        Toolkit tool = this.getToolkit();
        Image myimage = tool.getImage("skin/9000026/new_img/icon/logo.png");
        this.setIconImage(myimage);
        this.pack();
        this.setVisible(true);
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }


    @Override
    public void run() {
        try {
            checkUpdateJpanel.getUpdateView().update();
        } catch (Exception e) {
            // TODO 自动生成的 catch 块
            e.printStackTrace();
        }
    }

    public CheckUpdateJPanel getCheckUpdateJpanel() {
        return checkUpdateJpanel;
    }
}
